/*
 * @Author: 孙大大
 * @Date: 2022-04-13 18:29:36
 * @LastEditTime: 2022-04-13 18:29:38
 * @FilePath: \hmmm-xdy\src\api\articles.js
 */
import request from "@/utils/request";

export function getArticles(params) {
  return request({
    url: "/articles",
    method: "GET",
    params,
  });
}
export function postArticles(data) {
  return request({
    url: "/articles",
    method: "POST",
    data,
  });
}

export function putArticles(id, data) {
  return request({
    url: `/articles/${id}`,
    method: "PUT",
    data,
  });
}

export function delArticles(id) {
  return request({
    url: `/articles/${id}`,
    method: "DELETE",
  });
}

export function postState(id, state) {
  return request({
    url: `/articles/${id}/${state}`,
    method: "POST",
    data: { id, state },
  });
}

export function getshortName(params) {
  return request({
    url: "/companys",
    method: "GET",
    params,
  });
}
